window.addEvent('domready', function() {
    $$('.closedialog').addEvent('click', function() {
        $$('.modalarea').addClass('hidden');
        $$('.dialog').addClass('hidden');
    });
    
    $$('.fileinfo').addEvent('click', function() {
        var id = this.getProperty('id').substr(4);
        $$('.modalarea').removeClass('hidden');
        $$('.dialog').removeClass('hidden');
        
        new Ajax('index.php?option=com_docario&controller=file&task=showinfo&tmpl=component', {
                method: 'post',
                data: {
                    'fid': id
                },
                onSuccess: function (data) {
                    $('fileinfocontent').innerHTML = data;
                }
            }
        ).request();
    });
});
